package com.system.boot.company.converter;

import com.system.api.company.entity.dto.CompanyFormDto;
import com.system.api.company.entity.po.SysCompany;
import com.system.api.company.entity.search.CompanySearch;
import com.system.boot.setting.converter.DictConverter;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.yang.database.orm.entity.BaseQuery;

/**
 * @author: lslands
 * @description:
 * @version：v1.0
 * @date: 2024/6/1 21:32
 */
@Mapper(builder = @org.mapstruct.Builder(disableBuilder = true),componentModel = "spring")
public interface CompanyConverter {

    DictConverter INSTANCE = Mappers.getMapper(DictConverter.class);

    /**
     * 转换 dtoForm -> po
     * @param formDto 插入对象
     * @return SysDict
     */
    SysCompany formEntity(CompanyFormDto formDto);


    /**
     * 转换 search -> BaseQuery
     * @param search 搜索对象转换
     * @return BaseQuery
     */
    BaseQuery queryEntity(CompanySearch search);
}
